package com.webbei.servlet;

import java.util.List;

import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;

import org.springframework.web.context.WebApplicationContext;
import org.springframework.web.context.support.WebApplicationContextUtils;

import com.webbei.basic.init.InitProduct;
import com.webbei.pojo.Products;

public class InitServlet extends HttpServlet {
	private static WebApplicationContext springContext;
	private ServletContext context;
//	private ActionContext ac;

	@Override
	public void init() throws ServletException {
		super.init();
		springContext = WebApplicationContextUtils
				.getWebApplicationContext(this.getServletContext());
		InitProduct._servletContext = this.getServletContext();
		context = this.getServletContext();
		InitProduct.getInstance().init();
		List list = InitProduct.list;
		context.setAttribute("product", list);
	}
}